package com.newbsd.web.maventest.controller;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.newbsd.web.maventest.dao.UserDao;
import com.newbsd.web.maventest.dao.impl.UserDaoImpl;
import com.newbsd.web.maventest.pojo.User;

public class UserModServlet extends HttpServlet {

	private UserDao userDao = new UserDaoImpl();

	public void doGet(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {

		//int id = Integer.parseInt(request.getParameter("id"));
		
		request.setCharacterEncoding("utf-8");
		response.setContentType("text/html;charset=UTF-8");
		String username = request.getParameter("username");
		User user = userDao.getUser(username);
		
		request.setAttribute("user",user);
	
	
		request.getRequestDispatcher("/userinfoedit.jsp").forward(request,
				response);

	}

}
